<template>
  <a-button type="primary"
            :disabled="disa"
            v-if="show"
            @click="click">
    <slot>确定</slot>
  </a-button>
</template>
<script>

import PropType from '@zh/common-utils/prop-types'

export default {
  name: 'ZOkButton',
  props: {
    disabled: PropType.bool.def(false),
    show: PropType.bool.def(true)
  },
  data () {
    return {
      disa: this.disabled
    }
  },
  watch: {
    disabled () { },
    show () { }
  },
  methods: {
    click () {
      this.disa = true
      this.$emit('click')
      setTimeout(() => {
        this.disa = false
      }, 1500)
    }

  }
}
</script>
<style lang="less" scoped>
</style>